<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<!DOCTYPE html>
<html>
	<head>
		<title>编辑菜单</title>
		<meta name="decorator" content="default"/>
		<script type="text/javascript">
			$(function() {
				//初始化表单验证
				$("#inputForm").initValidform();
			});
		</script>
	</head>
	
	<body class="mainbody">
		<form:form id="inputForm" modelAttribute="menu" action="${ctx}/sys/menu/save" method="post" class="form-horizontal">
			<form:hidden path="id"/>
			<!--导航栏-->
			<div class="location">
				<a href="${ctx}/sys/menu/list" class="back"><i></i><span>返回列表页</span></a>
				<a href="${ctx}/center" class="home"><i></i><span>首页</span></a> 
				<i class="arrow"></i> 
				<a href="${ctx}/sys/menu/"><span>菜单管理</span></a>
				<shiro:hasPermission name="sys:menu:edit"><i class="arrow"></i><span>${not empty menu.id ? '修改':'添加' }菜单</span></shiro:hasPermission>
			</div>	
			<div class="line10"></div>
			<!--/导航栏-->
	
			<!--内容-->
			<div id="floatHead" class="content-tab-wrap">
				<div class="content-tab">
					<div class="content-tab-ul-wrap">
						<ul>
							<li><a class="selected" href="javascript:;">菜单信息</a></li>
						</ul>
					</div>
				</div>
			</div>
	
			<div class="tab-content">
				<dl>
					<dt>父级菜单</dt>
					<dd>
						<div class="rule-single-select single-select">
							<form:select path="parent.id" errormsg="请输入选择节点" sucmsg=" ">
								<form:option value="0" label="无父级菜单"></form:option>
								<form:options items="${parentMenus}" itemLabel="name" itemValue="id"/>
							</form:select>
						</div>
						<span class="Validform_checktip"></span>
					</dd>
				</dl>
				<dl>
					<dt>排序</dt>
					<dd>
						<form:input path="sort" htmlEscape="false" maxlength="50" class="required" cssClass="input small" datatype="*" nullmsg="请输入排序" errormsg="请输入排序" sucmsg=" "/>
						<span class="Validform_checktip">*请输入排序</span>
					</dd>
				</dl>
				<dl>
					<dt>名称</dt>
					<dd>
						<form:input path="name" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入名称" errormsg="请输入名称" sucmsg=" "/>
						<span class="Validform_checktip">*请输入名称</span>
					</dd>
				</dl>
				<dl>
					<dt>链接</dt>
					<dd>
						<form:input path="href" htmlEscape="false" maxlength="50" cssClass="input normal"/>
						<span class="Validform_checktip">*请输入链接</span>
					</dd>
				</dl>
				<dl>
					<dt>目标</dt>
					<dd>
						<form:input path="target" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入目标（mainFrame、 _blank、_self、_parent、_top）" errormsg="请输入目标（mainFrame、 _blank、_self、_parent、_top）" sucmsg=" "/>
						<span class="Validform_checktip">*请输入目标（mainFrame、 _blank、_self、_parent、_top）</span>
					</dd>
				</dl>
				<dl>
					<dt>图标</dt>
					<dd>
						<form:input path="icon" htmlEscape="false" maxlength="50" cssClass="input normal"/>
						<span class="Validform_checktip">顶级菜单才需要图标</span>
					</dd>
				</dl>
				<dl>
					<dt>是否隐藏</dt>
					<dd>
						<div class="rule-multi-radio">
							<form:radiobuttons path="isShow" items="${fns:getDictList('show_hide')}" itemLabel="label" itemValue="value" htmlEscape="false" class="required"/>
							<%-- <form:checkbox path="isShow" value="0" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入是否在菜单中显示（1：显示；0：不显示）" errormsg="请输入是否在菜单中显示（1：显示；0：不显示）" sucmsg=" "/> --%>
						</div>
						<span class="Validform_checktip"></span>
					</dd>
				</dl>
				<dl>
					<dt>备注信息</dt>
					<dd>
						<form:textarea rows="5" path="remarks" htmlEscape="false" maxlength="50" cssClass="input normal"/>
						<span class="Validform_checktip"></span>
					</dd>
				</dl>
				<dl>
					<dt>菜单标识</dt>
					<dd>
						<form:input path="navId" htmlEscape="false" maxlength="50" class="required" cssClass="input normal" datatype="*" nullmsg="请输入菜单标识" errormsg="请输入菜单标识" sucmsg=" "/>
						<span class="Validform_checktip">系统权限使用，勿操作</span>
					</dd>
				</dl>
				<dl>
					<dt>权限标识</dt>
					<dd>
						<div class="rule-multi-porp">
							<c:forEach items="${fns:getDictList('permission')}" var="perm">
								<input name="permission" class="input normal" maxlength="50" value="${perm.value}" <c:if test="${fn:contains(menu.permission, perm.value)}">checked="checked"</c:if> type="checkbox">
								<label for="permission">${perm.label}(${perm.value})</label>
							</c:forEach>
							<%-- <form:checkboxes path="permission" value="view" items="${fns:getDictList('permission')}"  itemLabel="label" itemValue="value" htmlEscape="false" maxlength="50" cssClass="input normal"/> --%>
						</div>
						<span class="Validform_checktip"></span>
					</dd>
				</dl>
			</div>
			<!--/内容-->
	
			<!--工具栏-->
			<div class="page-footer">
				<div class="btn-wrap">
					<input type="submit" name="btnSubmit" value="提交保存" id="btnSubmit" class="btn" /> 
					<input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);" />
				</div>
			</div>
			<!--/工具栏-->
		</form:form>
	</body>
</html>

